﻿using GriffinNav.Map.Logging;
using System;
using System.IO;
using System.Reflection;

namespace GriffinNav.Map
{

    internal static class Global
    {
        private static string mAssemblyPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetName().CodeBase);
        public static bool Debug = true;

        internal static string AssemblyPath
        {
            get
            {
                return mAssemblyPath;
            }
        }

        internal static void LogError(string assemblyName, Exception ex)
        {
            try
            {
                ErrorLog log = new ErrorLog();

                log.WriteError(assemblyName, ex);

                log = null;
            }
            finally { }
        }

        internal static void LogError(string assemblyName, MapException ex)
        {
            try
            {
                ErrorLog log = new ErrorLog();

                log.WriteError(assemblyName, ex);

                log = null;
            }
            finally { }
        }
    }
}
